<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Promise</title>
</head>
<body>
<script>
    let p = new Promise(((resolve, reject) => {
        setTimeout(() => {
            reject(20)
        }, 1000)
    }));
    p.then(result => {
        console.log('resolve:', result)
    }).catch(err => {
        console.log('error');
        console.log(err);
        throw new Error('catch a error')
    }).catch(err => {
        console.log(err)
    })
</script>
</body>
</html>
